package Thread2;

public class Demo11 {
    public static void main(String[] args) throws InterruptedException {
        Thread t = new Thread(()->{
            for (int i = 0; i < 3000; i++) {
                System.out.println("hello Thread!");
                try {
                    Thread.sleep(1000);
                } catch (InterruptedException e) {
                    throw new RuntimeException(e);
                }
            }
            System.out.println("t 线程结束");
        });
        t.start();


        t.join(3000);
        // Thread.sleep(3000);
        System.out.println("Main 线程结束!");
    }

}
